package com.example.springbootEncrypt;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

import java.net.InetAddress;

@SpringBootApplication
public class SpringbootEncryptApplication {

    public static void main(String[] args) {
        Environment env = new SpringApplication(SpringbootEncryptApplication.class).run(args).getEnvironment();
        String envPort = env.getProperty("server.port");
        String envContext = env.getProperty("server.servlet.context-path");
        //server.servlet.context-path=/ksc-base-info
        String port = envPort == null ? "8080" : envPort;
        String context = envContext == null ? "" : envContext;
        String path = port + "" + context + "/doc.html";
        System.out.println("swagger: http://127.0.0.1:" + path);
    }
}
